/*package cn.wx.scholar.kafka;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class KafkaSender {

	Logger logger = LoggerFactory.getLogger(KafkaSender.class);
	
    @Autowired
    private KafkaTemplate<String, Object> kafkaTemplate;

    @Scheduled(cron="0 0/1 *  * * ? ") 
    public void send() {
        kafkaTemplate.send("test", "zhang jian");
        logger.info("发送消息为:" +  "zhang jian");
    }

    
    @KafkaListener(topics = {"test"},groupId="scholar")
    public void listen(ConsumerRecord<?, ?> record) {
    	logger.info("接收消息为:" + record.value());
    }
    
}
*/